using EnvDTE;
using Microsoft.Practices.RecipeFramework;

namespace PrismFactory.SoftwareFactory.Extensions.Actions.VisualStudio
{
    /// <summary>
    /// Sets the startup project for the solution.
    /// </summary>
    public class SetStartupProjectAction : ConfigurableAction
    {
        [Input(Required = true)]
        public object Project { get; set; }

        public override void Execute()
        {
            if (Project != null)
            {
                var dte = GetService<DTE>();
                dte.Solution.Properties.Item("StartupProject").Value = Project;
            }
        }

        public override void Undo()
        {
        }
    }
}